import javax.swing.JFrame;

import org.math.plot.Plot2DPanel;

import com.googlecode.gunncs.sensor.RandomGaussian;

public class GaussianTest {
	public static void main(String[] args) {

		// define your data
		// double[] x = randomLogNormal(1000, 0, 0.5); // 1000 random numbers
		// from
		// a log normal statistical
		// law
		RandomGaussian gaussian = new RandomGaussian();
		double MEAN = 0;
		double VARIANCE = 5.0f;
		// for (int idx = 1; idx <= 10; ++idx) {
		// log("Generated : " + gaussian.getGaussian(MEAN, VARIANCE));
		// }

		double[] x = new double[100000];
		for (int i = 0; i < x.length; i++) {
			x[i] = gaussian.getGaussian(MEAN, VARIANCE);
		}

		// create your PlotPanel (you can use it as a JPanel)
		Plot2DPanel plot = new Plot2DPanel();

		// add the histogram (50 slices) of x to the PlotPanel
		plot.addHistogramPlot("Log Normal population", x, 50);

		// put the PlotPanel in a JFrame like a JPanel
		JFrame frame = new JFrame("a plot panel");
		frame.setSize(600, 600);
		frame.setContentPane(plot);
		frame.setVisible(true);

	}
}